import { Controller, Get, Param } from '@nestjs/common';
import { UsersService } from './users.service';
import { User } from './user.entity';
import { Photo } from 'src/photos/photo.entity';

@Controller('users')
export class UsersController {
  constructor(private usersService: UsersService) {}

  //   @Get(':id')
  //   async findOne(@Param('id') id: string) {
  //     return await this.usersService.findOne(id);
  //   }

  @Get('test1')
  async createTwo() {
    const user1 = new User();
    user1.firstName = 'si';
    user1.lastName = 'li';
    user1.isActive = true;

    const user2 = new User();
    user2.firstName = 'wu';
    user2.lastName = 'wang';
    user2.isActive = false;

    const data: User[] = [user1, user2];
    return await this.usersService.createMany(data);
  }
}
